package zxs.sino.elite.hub.enums.article;

import zxs.sino.elite.hub.enums.BaseEnum;


/**
 * 文章可见类型
 *
 * @author zhang
 */
public enum ViewType implements BaseEnum<Integer> {


    ALL_AVAILABLE(1, "全部可见"),
    ONLY_VISIBLE_ONESELF(2, "仅自己可见"),
    ONLY_VISIBLE_FANS(3, "仅粉丝可见");

    private final int code;
    private final String value;

    ViewType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static boolean isAllAvailable(Integer code) {
        return BaseEnum.isType(ViewType.class, code, ALL_AVAILABLE);
    }

    public static boolean isOnlyVisibleOneself(Integer code) {
        return BaseEnum.isType(ViewType.class, code, ONLY_VISIBLE_ONESELF);
    }

    public static boolean isOnlyVisibleFans(Integer code) {
        return BaseEnum.isType(ViewType.class, code, ONLY_VISIBLE_FANS);
    }
}